package com.example.mapper;

import com.example.pojo.Ticket;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface TicketMapper {
    @Select("select * from ticket_info;")
    public List<Ticket> selectAll();

    @Insert("insert into ticket_info (name,price,db_name) values (#{name},#{price},Database())")
    public boolean insertTicket(Ticket ticket);

    @Select("select * from ticket_info where id=#{id}")
    public Ticket getTicket(long id);


}
